<template>
  <div class="app-container">
    <template>
      <div class="right-detail">
        <div class="cbox">
          <el-form class="form" :model="queryParam" ref="queryParam" :rules="rules" :inline="true" size="mini">
            <!-- <el-row :gutter="12" class="row"> -->
            <!-- <el-col :span="4"> -->
            <el-form-item size="mini" label="标的编号:" prop="bidCode">
              <el-input clearable v-model="queryParam.bidCode" size="mini" style="width: 180px"></el-input>
            </el-form-item>
            <!-- </el-col> -->
            <!-- <el-col :span="4"> -->
            <el-form-item size="mini" label="竞价状态:" prop="bidBiddingstatus">
              <el-select clearable v-model="queryParam.bidBiddingstatus" style="width: 180px" placeholder="请选择">
                <el-option v-for="(item, index) in statusList" :key="index" :value="item.code" :label="item.name"></el-option>
              </el-select>
            </el-form-item>
            <!-- </el-col> -->
            <!-- <el-col :span="2"> -->
            <el-form-item>
              <el-button @click="searchType" type="primary">查询</el-button>
            </el-form-item>
            <!-- </el-col> -->
            <!-- </el-row> -->
          </el-form>
        </div>
        <split-pane split="horizontal" v-on:resize="resize" :default-percent="55" :max-percent="80">
          <!-- 上半部分 -->
          <template slot="paneL">
            <div class="top-type" ref="topType" style="top:49%">
              <div class="btn-area" ref="btnArea">
                <buttonName @clickEvent="clickEventDom"></buttonName>
                <!-- <el-button plain size="mini" type="primary" v-if="isAuth('releaseBidding')" @click="releaseBidding">发布竞价</el-button>
                <el-button plain size="mini" type="primary" v-if="isAuth('delReleasee')" @click="delReleasee">取消发布</el-button>
                <el-button plain size="mini" type="primary" v-if="isAuth('annouce')" @click="annouce">公告发布</el-button>
                <el-button plain size="mini" type="primary" v-if="isAuth('internalSpecify')" @click="internalSpecify">内部指定</el-button>-->
              </div>

              <!-- 状态（E-启用 N-未启用 D-停用） -->
              <el-table
                :data="TypeList"
                class="demand"
                :height="typeHeight"
                highlight-current-row
                @row-click="getCurrentTypeRow"
                @selection-change="rowSelectionChange"
                border
                :header-cell-style="{ textAlign: 'center' }"
                :cell-style="{}"
              >
                <!-- <el-table-column type="selection"  align="center" width="55"></el-table-column> -->
                <el-table-column size="mini" show-overflow-tooltip type="index" label="序号" align="center" width="60">
                  <template slot-scope="scope">
                    <span>{{ (Pagination.currentPage - 1) * Pagination.pageSize + scope.$index + 1 }}</span>
                  </template>
                </el-table-column>
                <el-table-column align="center" label="竞价状态" prop="bidBiddingstatus" width="80" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span v-if="scope.row.bidBiddingstatus == 'N' && scope.row.bidInternalStatus != 'Y'">未发布</span>
                    <span v-if="scope.row.bidBiddingstatus == 'Y' && scope.row.bidInternalStatus != 'Y'">已发布</span>
                    <span v-if="scope.row.bidBiddingstatus == 'N' && scope.row.bidInternalStatus == 'Y'">部分指定</span>
                    <span v-if="scope.row.bidBiddingstatus == 'Y' && scope.row.bidInternalStatus == 'Y'">内部指定</span>
                  </template>
                </el-table-column>
                <el-table-column size="mini" width="120" prop="bidCode" align="center" label="标的编号"></el-table-column>
                <el-table-column size="mini" show-overflow-tooltip prop="bidType" align="center" label="标的类型"></el-table-column>
                <el-table-column size="mini" show-overflow-tooltip prop="bidName" width="220" align="center" label="标的名称"></el-table-column>
                <el-table-column align="center" label="是否与平台合作" prop="bidPlatformTogether" width="130" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span v-if="scope.row.bidPlatformTogether == 'N'">否</span>
                    <span v-if="scope.row.bidPlatformTogether == 'Y'">是</span>
                  </template>
                </el-table-column>
                <!-- <el-table-column align="center" label="是否已指定供应商" prop="bidAppointIds" width="80" show-overflow-tooltip>
                <template slot-scope="scope">
                    <span v-if="!scope.row.bidAppointIds">否</span>
                    <span v-else>是</span>
                  </template>
                </el-table-column>-->
                <el-table-column size="mini" show-overflow-tooltip width="120" prop="bidAmount" align="center" label="运输总量（吨）"></el-table-column>
                <el-table-column size="mini" show-overflow-tooltip prop="bidQuotations" align="left" label="竞价方式"></el-table-column>
                <!-- <el-table-column size="mini" show-overflow-tooltip prop="bidRange" align="center" label="招标范围"></el-table-column> -->
                <el-table-column size="mini" width="150" prop="bidSignupStart" align="center" label="竞价报名开始时间"></el-table-column>
                <el-table-column size="mini" width="150" prop="bidSignupEnd" align="center" label="竞价报名结束时间"></el-table-column>
                <el-table-column size="mini" width="150" prop="bidBiddingStart" align="center" label="竞价开始时间"></el-table-column>
                <el-table-column size="mini" width="150" prop="bidBiddingEnd" align="center" label="竞价结束时间"></el-table-column>
                <!-- <el-table-column size="mini" show-overflow-tooltip prop="bidServiceCharge" align="center" label="运输信息服务费"></el-table-column> -->
                <el-table-column size="mini" width="150" prop="bidOffer" align="center" label="单价竞价范围（元/吨）"></el-table-column>
                <el-table-column show-overflow-tooltip align="center" width="120" prop="dptName" label="标的来源"></el-table-column>
                <el-table-column size="mini" show-overflow-tooltip header-align="left" align="left" prop="bidRemark" label="备注"></el-table-column>
              </el-table>
              <div>
                <el-pagination
                  class="pagination"
                  small
                  background
                  ref="pagination"
                  @size-change="handleSizeChange"
                  @current-change="handleCurrentChange"
                  :current-page="Pagination.currentPage"
                  :page-sizes="Pagination.pageSizeList"
                  :page-size="Pagination.pageSize"
                  :layout="Pagination.layout"
                  :total="Pagination.total"
                ></el-pagination>
              </div>
            </div>
          </template>

          <!-- 下半部分 -->
          <template slot="paneR">
            <div class="codeNumberCode" style="background-color: #fff;">需求信息</div>
            <div class="bottom-code" ref="bottomCode" style="background-color: #fff;">
              <div class="btn-area" ref="detlArea">
                <el-button plain size="mini" type="primary" @click="internalSpecify">内部指定</el-button>
                <el-button plain size="mini" type="primary" @click="delInternalSpecify">取消内部指定</el-button>
              </div>
              <el-table
                :height="detlHeight"
                @row-click="getCurrentCodeRow"
                border
                @selection-change="rowSelectionChange"
                :data="currentCodeList"
                highlight-current-row
                :header-cell-style="{
                  textAlign: 'center'
                }"
                :cell-style="{}"
              >
                <!-- <el-table-column type="selection"  align="center" width="55"></el-table-column> -->
                <el-table-column type="index" show-overflow-tooltip align="center" width="50" label="序号"></el-table-column>
                <el-table-column size="mini" show-overflow-tooltip align="center" width="120" label="是否内部指定">
                  <template slot-scope="scope">
                    <span v-if="scope.row.id">是</span>
                    <span v-if="!scope.row.id">否</span>
                  </template>
                </el-table-column>
                <el-table-column size="mini" show-overflow-tooltip width="120" align="left" prop="demandCode" label="需求编号"></el-table-column>
                <el-table-column show-overflow-tooltip align="center" prop="brand" label="货物品牌"></el-table-column>
                <el-table-column show-overflow-tooltip align="center" prop="dailyOutput" label="规格"></el-table-column>
                <el-table-column size="mini" show-overflow-tooltip prop="product" align="center" label="产品大类"></el-table-column>
                <el-table-column size="mini" show-overflow-tooltip prop="kind" align="center" label="品种"></el-table-column>
                <!-- <el-table-column show-overflow-tooltip align="center" prop="goodsCode" label="货物编码"></el-table-column> -->
                <el-table-column show-overflow-tooltip align="center" prop="transportType" label="运输类型"></el-table-column>
                <el-table-column size="mini" show-overflow-tooltip prop="transportMode" align="center" label="运输方式"></el-table-column>
                <el-table-column show-overflow-tooltip align="center" prop="transportQuantity" label="运输数量(吨)" width="120"></el-table-column>
                <el-table-column show-overflow-tooltip align="center" prop="terminationWeight" label="终止剩余重量(吨)" width="140"></el-table-column>
                <!-- <el-table-column show-overflow-tooltip align="center" prop="specialRequire" label="特殊要求"></el-table-column> -->
                <el-table-column show-overflow-tooltip align="center" prop="dptName" label="需求来源"></el-table-column>
                <el-table-column size="mini" show-overflow-tooltip prop="remark" align="center" label="备注"></el-table-column>
                <el-table-column width="218" align="center" label="操作">
                  <template slot-scope="scope">
                    <el-button size="mini" type="primary" plain @click="showTransportMethod(scope.row)">线路详情</el-button>
                    <el-button size="mini" type="primary" plain @click="internaDetail(scope.row)">内部指定详情</el-button>
                  </template>
                </el-table-column>
              </el-table>
              <!-- <div>
                <el-pagination
                  class="pagination"
                  small
                  background
                  @size-change="handleSizeChangeA"
                  @current-change="handleCurrentChangeA"
                  :current-page="currentPage"
                  :page-sizes="[30, 60, 90, 120]"
                  :page-size="30"
                  layout="sizes, prev, pager, next, jumper, total"
                  :total="pageTotal"
                ></el-pagination>
              </div>-->
            </div>
          </template>
        </split-pane>
      </div>
    </template>

    <!-- 发布招标dialog -->
    <el-dialog
      width="60%"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      v-el-drag-dialog
      title="发布竞价信息"
      :visible.sync="RefTypeDialogVisible"
      v-if="RefTypeDialogVisible"
      :before-close="handleTypeDialogClose"
    >
      <el-form label-position="right" :model="RefTypeData" ref="RefTypeData" :rules="RefTypeDataRules" label-width="auto" size="mini">
        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item prop="bidSignupStart" label="竞价报名开始时间：">
              <el-date-picker
                v-model="RefTypeData.bidSignupStart"
                style="width:50%"
                @change="startTimeChange"
                clearable
                :disabled="see"
                type="date"
                value-format="yyyy-MM-dd "
                :picker-options="expireTimeOption"
              ></el-date-picker>
              <div style="width:5%;display:inline-block;text-align:center;">:</div>
              <div style="width:20%;display:inline-block;">
                <el-input maxlength="2" v-model="inputData" @change="inputvalue" @keyup.native="nextFocus"></el-input>
              </div>
              <div style="width:5%;display:inline-block;text-align:center;">:</div>
              <div style="width:20%;display:inline-block;">
                <el-input maxlength="2" v-model="inputDataB" ref="obj" @change="inputvalueB"></el-input>
              </div>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="bidSignupEnd" label="竞价报名结束时间：">
              <el-date-picker
                v-model="RefTypeData.bidSignupEnd"
                style="width:50%"
                @change="endTimeChange"
                clearable
                :disabled="see"
                type="date"
                value-format="yyyy-MM-dd"
                :picker-options="expireTimeOption"
              ></el-date-picker>
              <div style="width:5%;display:inline-block;text-align:center;">:</div>
              <div style="width:20%;display:inline-block;">
                <el-input maxlength="2" v-model="inputDataC" @change="inputvalueC" @keyup.native="nextFocusA"></el-input>
              </div>
              <div style="width:5%;display:inline-block;text-align:center;">:</div>
              <div style="width:20%;display:inline-block;">
                <el-input maxlength="2" v-model="inputDataD" ref="objA" @change="inputvalueD"></el-input>
              </div>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item prop="bidBiddingStart" label="竞价开始时间：">
              <el-date-picker
                v-model="RefTypeData.bidBiddingStart"
                style="width:50%"
                @change="startTimeBidding"
                clearable
                :disabled="see"
                type="date"
                value-format="yyyy-MM-dd"
                :picker-options="expireTimeOption"
              ></el-date-picker>
              <div style="width:5%;display:inline-block;text-align:center;">:</div>
              <div style="width:20%;display:inline-block;">
                <el-input maxlength="2" v-model="inputDataE" @change="inputvalueE" @keyup.native="nextFocusB"></el-input>
              </div>
              <div style="width:5%;display:inline-block;text-align:center;">:</div>
              <div style="width:20%;display:inline-block;">
                <el-input maxlength="2" v-model="inputDataF" ref="objB" @change="inputvalueF"></el-input>
              </div>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="bidBiddingEnd" label="竞价结束时间：">
              <el-date-picker
                v-model="RefTypeData.bidBiddingEnd"
                style="width:50%"
                @change="endTimeBidding"
                clearable
                :disabled="see"
                type="date"
                value-format="yyyy-MM-dd"
                :picker-options="expireTimeOption"
              ></el-date-picker>
              <div style="width:5%;display:inline-block;text-align:center;">:</div>
              <div style="width:20%;display:inline-block;">
                <el-input maxlength="2" v-model="inputDataG" @change="inputvalueG" @keyup.native="nextFocusC"></el-input>
              </div>
              <div style="width:5%;display:inline-block;text-align:center;">:</div>
              <div style="width:20%;display:inline-block;">
                <el-input maxlength="2" v-model="inputDataH" ref="objC" @change="inputvalueH"></el-input>
              </div>
            </el-form-item>
          </el-col>
        </el-row>
        <el-col :span="24">
          <el-form-item label="指定供应商：">
            <el-form-item prop="bidAppointIds">
              <el-select v-model="value2" style="width: 100%;" size="medium" filterable multiple placeholder="请选择">
                <el-checkbox v-model="checked" @change="selectAll">全选</el-checkbox>
                <el-option v-for="item in options" :key="item.uuid" :label="item.fltName" :value="item.uuid"></el-option>
              </el-select>
            </el-form-item>
          </el-form-item>
        </el-col>
        <el-col :span="24" style="margin-top:-12px">
          <el-form-item prop label="单价竞价范围（元/吨）：">
            <el-col :span="11">
              <el-input-number
                v-model="RefTypeData.bidOfferStart"
                controls-position="right"
                style="width: 100%;"
                @change="vaidateCycle"
                :min="0"
                :precision="1"
                :step="0.5"
              ></el-input-number>
            </el-col>
            <el-col class="line" :span="2" style="text-align:center;">——</el-col>
            <el-col :span="11">
              <el-input-number
                v-model="RefTypeData.bidOfferEnd"
                style="width: 100%;"
                controls-position="right"
                @change="vaidateEnd"
                :precision="1"
                :step="0.5"
              ></el-input-number>
            </el-col>
          </el-form-item>
        </el-col>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button size="mini" @click="RefTypeDialogVisible = false">关闭</el-button>
        <el-button style="margin-left:40px" size="mini" type="primary" @click="releaseTrue">确认发布</el-button>
      </div>
    </el-dialog>

    <!-- 指定供应商 -->
    <el-dialog
      width="70%"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      v-el-drag-dialog
      title="内部指定"
      :visible.sync="appointDialogVisible"
      v-if="appointDialogVisible"
      :before-close="handleCodeDialogClose"
    >
      <div class="heis">
        <div class="left">运输总数量(吨)：{{ this.currentCode.transportQuantity }}</div>
        <div class="sysj">已配额(吨)：{{ addUp }}</div>
        <div class="rigth">剩余需配额数(吨):{{ b }}</div>
      </div>
      <div style="margin-top:-30px;float: left;">
        <el-button type="success" @click="addItem" size="small">新增</el-button>
      </div>
      <el-form :inline="true" :model="ruleForms" label-position="right" ref="ruleForms" :rules="appointDataRules" label-width="auto" size="mini">
        <el-row v-for="(item, index) in ruleForms.appointData" :key="item">
          <!-- <el-form
              :inline="true"
              :model="ruleForms.appointData[index]"
              ref="ruleForms"
              :rules="appointDataRules"
              label-width="100px"
              class="demo-form-inline"
              size="small"
          >-->
          <el-form-item label="供应商：" :prop="'appointData.' + index + '.bidInternalSpecify'" :rules="appointDataRules.bidInternalSpecify">
            <el-select v-model="ruleForms.appointData[index].bidInternalSpecify" style="width:100%" filterable clearable placeholder="请选择">
              <el-option v-for="item in options" :key="item.uuid" :label="item.fltName" :value="item.uuid"></el-option>
            </el-select>
          </el-form-item>

          <el-form-item label="单价(元/吨)：" label-width="50" :prop="'appointData.' + index + '.biddingPrice'" :rules="appointDataRules.biddingPrice">
            <el-input
              v-model="ruleForms.appointData[index].biddingPrice"
              @change="inOfeer(index)"
              style="width:100%"
              filterable
              clearable
              placeholder="请输入单价"
            ></el-input>
          </el-form-item>

          <el-form-item label="配额(吨)：" :prop="'appointData.' + index + '.biddingQuota'" :rules="appointDataRules.biddingQuota">
            <el-input
              v-model="ruleForms.appointData[index].biddingQuota"
              @input="inQuotaOfeer(index)"
              style="width:100%"
              filterable
              clearable
              placeholder="请输入分配吨数"
            ></el-input>
          </el-form-item>

          <el-form-item>
            <el-button v-if="index != 0" type="danger" @click="del(index)" size="small">删除</el-button>
          </el-form-item>
          <!-- </el-form> -->
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button size="mini" @click="handleCodeDialogClose">关闭</el-button>
        <el-button size="mini" type="primary" @click="appointTrue">确认指定</el-button>
      </div>
    </el-dialog>

    <el-dialog
      width="40%"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      v-el-drag-dialog
      title="线路详情"
      :visible.sync="tranDialogInfoDialogVisible"
      v-if="tranDialogInfoDialogVisible"
      :before-close="handleTypeDialogClose"
    >
      <el-table
        :data="tranDialogInfoList"
        :height="detlHeight"
        highlight-current-row
        border
        :header-cell-style="{
          textAlign: 'center'
        }"
        :cell-style="{}"
      >
        <el-table-column type="index" width="60" align="center" label="序号"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" label="起始地" prop="site"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" label="目的地" prop="destination"></el-table-column>
      </el-table>
      <span slot="footer" class="dialog-footer">
        <el-button
          size="mini"
          type="primary"
          @click="
            tranDialogInfoDialogVisible = false
            tranDialogInfoList = []
          "
          >关闭</el-button
        >
      </span>
    </el-dialog>

    <!--添加供应商-->
    <el-dialog title="添加供应商" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
      <el-form :model="addform">
        <el-col :span="24">
          <el-form-item label="指定供应商：">
            <el-form-item prop="bidAppointIds">
              <el-select v-model="addform.bidAppointIds" style="width: 100%;" size="medium" filterable multiple placeholder="请选择">
                <el-checkbox v-model="checked" @change="selectAllgys">全选</el-checkbox>
                <el-option v-for="item in options" :key="item.uuid" :label="item.fltName" :value="item.uuid"></el-option>
              </el-select>
            </el-form-item>
          </el-form-item>
        </el-col>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="addSave">保 存</el-button>
      </div>
    </el-dialog>

    <!-- 公告发布 -->
    <el-dialog
      width="50%"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      @close="annexDialogClose"
      v-el-drag-dialog
      title="公告发布"
      :visible.sync="annoucetDialog"
    >
      <el-form label-position="right" :model="annouceData" ref="annouceData" :rules="annouceDataRules" label-width="auto" size="mini">
        <el-row>
          <el-col :span="19">
            <el-form-item prop="bidTitle" label="标题：">
              <el-input v-model="annouceData.bidTitle" placeholder="请输入标题" clearable filterable></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="2">
            <el-button plain type="primary" size="mini" style="margin-left: 20px;" @click="addAnnex">添加附件</el-button>
          </el-col>
          <el-col :span="22">
            <el-form-item prop="bidContent" label="内容：">
              <Editor v-model="annouceData.bidContent" />
              <!-- <el-input v-model="annouceData.bidContent" type="textarea" rows="5" cols="5"
              placeholder="请输入内容" ></el-input>-->
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer" style="margin-top: 20px;">
        <el-button size="mini" @click="annoucetDialog = false">关闭</el-button>
        <el-button size="mini" type="primary" @click="annouceTrue">确认发布</el-button>
      </div>
    </el-dialog>

    <el-dialog
      width="50%"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      v-el-drag-dialog
      title="内部指定详情"
      :visible.sync="internalDialogVisible"
      v-if="internalDialogVisible"
      :before-close="handleTypeDialogClose"
    >
      <el-table
        :data="internalList"
        :height="detlHeight"
        highlight-current-row
        border
        :header-cell-style="{
          textAlign: 'center'
        }"
        :cell-style="{}"
      >
        <el-table-column type="index" width="60" align="center" label="序号"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" label="供应商" prop="fltName"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" label="单价(元/吨)" prop="biddingPrice"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" label="配额(吨)" prop="biddingQuota"></el-table-column>
      </el-table>
      <span slot="footer" class="dialog-footer">
        <el-button
          size="mini"
          type="primary"
          @click="
            internalDialogVisible = false
            internalList = []
          "
          >关闭</el-button
        >
      </span>
    </el-dialog>

    <!--文件上传-->
    <el-dialog
      width="30%"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      v-el-drag-dialog
      :title="annexDialog.title"
      :visible.sync="annexDialog.show"
    >
      <el-row align="middle">
        <el-col align="middle">
          <el-upload
            class="upload-demo"
            drag
            ref="annexUpload"
            :action="annexDialog.uploadUrl"
            multiple
            :auto-upload="false"
            :file-list="annexDialog.fileList"
            :data="annexDialog.data"
            :on-error="fileUploadFileCallBack"
            name="files"
            :headers="annexDialog.headers"
          >
            <i class="el-icon-upload"></i>
            <div class="el-upload__text">将文件拖到此处，或点击<em>添加文件</em></div>
            <div class="el-upload__tip" slot="tip">文件大小不能超过10m</div>
          </el-upload>
        </el-col>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button
          @click="
            annexDialog.show = false
            annexDialog.fileList = []
          "
          >取 消</el-button
        >
        <el-button type="primary" @click="doUploadFile">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import {
  updategys,
  queryBiddingList,
  auditBiddingMethod,
  bidListDetail,
  querySugarListDetail,
  updateTotal,
  releaseBiddingMethod,
  checkSysfleetList,
  queryDemandLine,
  queryAnnouncement,
  addAnnouncement,
  internalSpecifyBidding,
  internalDesignationBidding,
  delInternalDesignation,
  internalDesignationDetail
} from '@/request/api'
import resizeMixin from '@/mixins/resize'
import paginationMixin from '@/mixins/pagination'
import isAuth from '@/mixins/buttonAuth'
import Editor from '@/components/Editor'
import scrollChange from '@/utils/onscroll.js'
import buttonName from '@/components/buttonName/button-name.vue'
import store from '@/store'
export default {
  components: {
    Editor,
    buttonName
  },
  mixins: [resizeMixin, paginationMixin, isAuth],
  data() {
    // var dateFormat = (rule,value,callback) =>{
    //   var reg = /^(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/;
    //   var regExp = new RegExp(reg);
    //   if(!regExp.test(value)){
    //      return callback(new Error('时间格式不正确，正确格式为：12:00:00'))
    //   }
    // }
    var RVNAME = (rule, value, callback) => {
      // 获得字符串实际长度，中文2，英文1
      var realLength = 0,
        len = value.length,
        charCode = -1
      for (var i = 0; i < len; i++) {
        charCode = value.charCodeAt(i)
        if (charCode >= 0 && charCode <= 128) realLength += 1
        else realLength += 2
      }
      if (realLength > 32) {
        return callback(new Error('最多为32位'))
        // this.companyName = cutstr(this.companyName, 60);
      } else {
        return callback()
      }
    }
    var RVREMARK = (rule, value, callback) => {
      // 获得字符串实际长度，中文2，英文1
      var realLength = 0,
        len = value.length,
        charCode = -1
      for (var i = 0; i < len; i++) {
        charCode = value.charCodeAt(i)
        if (charCode >= 0 && charCode <= 128) realLength += 1
        else realLength += 2
      }
      if (realLength > 128) {
        return callback(new Error('最多为128位'))
        // this.companyName = cutstr(this.companyName, 60);
      } else {
        return callback()
      }
    }
    const bidAppointIdsValidator = (rule, value, callback) => {
      if (this.value2.length) {
        callback()
      }
      callback(new Error('请指定供应商'))
    }
    return {
      annexDialog: {
        show: false,
        title: '添加附件',
        uploadUrl: (process.env.NODE_ENV === 'development' ? '/proxy' : '') + '/FTKJWLHYPT/bidding/uploadFile',
        fileList: [],
        data: {
          id: undefined
        },
        headers: {
          Token: store.state.user.Session_Token
        }
      },
      addform: {
        bidAppointIds: []
      },
      dialogFormVisible: false,
      expireTimeOption: {
        disabledDate(date) {
          return date.getTime() < new Date().getTime() - 86400000
        }
      },
      inputData: '',
      inputDataB: '',
      inputDataC: '',
      inputDataD: '',
      inputDataE: '',
      inputDataF: '',
      inputDataG: '',
      inputDataH: '',
      queryParam: {
        bidCode: '', // 标的编号
        bidBiddingstatus: 'N' // 标的竞价状态
      },
      diaTableData: [], // 弹出框需求信息信息
      statusList: [{ code: 'N', name: '未发布' }, { code: 'Y', name: '已发布' }, { code: 'I', name: '内部指定' }, { code: 'B', name: '部分指定' }],
      options: [
        {
          value: '选项1',
          label: '黄金糕'
        },
        {
          value: '选项2',
          label: '双皮奶'
        },
        {
          value: '选项3',
          label: '蚵仔煎'
        },
        {
          value: '选项4',
          label: '龙须面'
        },
        {
          value: '选项5',
          label: '北京烤鸭'
        }
      ],
      value1: [],
      value2: [],
      kinds: {
        BROW: '赤砂糖',
        TWOW: '二级白砂糖',
        ONEW: '一级白砂糖'
      },
      currentPage: 1,
      pageSize: 30,
      pageTotal: 0,

      currentRow: '',
      codeentRow: '',
      typeHeight: -1,
      detlHeight: -1,
      CodeRCTUUID: false,
      CodeRVDOMAIN: false,
      checked: false,
      checkedY: true,
      checkedN: false,
      flt: {
        rvDomain: '',
        rvName: ''
      },
      copyDomain: '',
      copyName: '',
      rleTypes: [],
      TypeMap: {
        updateType: 'baseCode.editClassify',
        createType: 'baseCode.addClassify'
      },
      CodeMap: {
        updateCode: 'baseCode.editCode',
        createCode: 'baseCode.addCode'
      },
      TypeDialogStatus: '',
      CodeDialogStatus: '',
      currentNode: {},
      currentType: {},
      TypeList: [],
      currentCodeList: [],
      currentCode: {},
      tranDialogInfoList: [],
      tranDialogInfoDialogVisible: false, //线路详情Dialog
      appointDialogVisible: false, //指定供应商 Dialog

      internalList: [],
      internalDialogVisible: false, //线路详情Dialog
      // appointData:{
      //   bidInternalSpecify:'',
      //   biddingPrice:'',
      // },

      ruleForms: {
        appointData: [
          {
            bidInternalSpecify: '',
            biddingPrice: '',
            biddingQuota: ''
          }
        ]
      },

      annoucetDialog: false, //发布公告 Dialog
      annouceData: {
        //发布公告数据
        bidTitle: '',
        bidContent: '',
        maxLength: 3000 // 最大长度
      },
      RefTypeDialogVisible: false, // 代码分类 Dialog
      RefCodeDialogVisible: false, // 基础代码 Dialog
      dialogFrom: {
        data: {},
        rules: {}
      },
      dialogText: {
        title: '',
        show: false,
        button: {
          t: '',
          f: ''
        },
        qeuryButtonShow: false,
        paginationShow: false
      },
      a: 0,
      b: 0,
      c: 0,
      d: 0,
      selNoApproveArray: [], //未发布的信息
      selApproveArray: [], //已发布的信息
      rowIdArray: [], //多选行数的id

      // 代码分类
      RefTypeData: {}, // 代码分类 dialog内的form([A-Z]|\d)[0-9a-zA-Z]
      rules: {
        RV_DOMAIN: [
          { min: 1, max: 4, message: '至多输入4 个字符', trigger: 'change' },
          {
            pattern: /^([^\u4e00-\u9fa5])+$/,
            message: '禁止输入中文',
            trigger: 'change'
          }
        ],
        RV_NAME: [
          { validator: RVNAME, trigger: 'change' },
          {
            pattern: /^([0-9a-zA-Z\u4e00-\u9fa5])+$/,
            message: '只能输入中文字母数字',
            trigger: 'change'
          }
        ]
      },
      RefTypeDataRules: {
        bidSignupStart: [{ required: true, message: '请选择竞价报名开始时间', trigger: 'blur' }],
        // bidSignupStartA:[
        //    { validator: dateFormat, trigger: 'change' },
        // ],

        bidSignupEnd: [{ required: true, message: '请选择竞价报名结束时间', trigger: 'blur' }],
        bidBiddingStart: [{ required: true, message: '请选择竞价开始时间', trigger: 'blur' }],
        bidBiddingEnd: [{ required: true, message: '请选择竞价结束时间', trigger: 'blur' }],
        bidServiceCharge: [
          { required: true, message: '请填写运输信息服务费', trigger: 'blucr' },
          {
            pattern: /^\d+\.?(\d{1,2})?$/,
            message: '只能输入数字和两位小数',
            trigger: 'change'
          }
        ],
        bidOffer: [],
        bidOfferStart: [{ required: true, message: '请填写竞价范围', trigger: 'blur' }],
        bidOfferEnd: [{ required: true, message: '请填写竞价范围', trigger: 'blur' }],
        bidAppointIds: [
          {
            validator: bidAppointIdsValidator,
            trigger: ['blur', 'change']
          }
        ]
      },
      annouceDataRules: {
        bidTitle: [{ required: true, message: '请输入标题', trigger: 'blur' }],
        bidContent: [{ required: true, message: '请输入内容', trigger: 'blur' }]
      },
      appointDataRules: {
        bidInternalSpecify: [{ required: true, message: '请选择供应商', trigger: 'blur' }],
        biddingPrice: [
          { required: true, message: '请输入单价', trigger: 'blur' },
          {
            pattern: /^\d+\.?(\d{1,2})?$/,
            message: '只能输入数字和两位小数',
            trigger: 'change'
          }
        ],
        biddingQuota: [{ required: true, message: '请输入配额', trigger: 'blur' }]
      },
      // 基础代码
      RefCodeData: {}, // 代码分类 dialog内的form
      RefCodeDataRules: {
        rvDomain: [{ required: true, message: '请选择代码类型', trigger: 'change' }],
        rvLowValue: [
          { min: 1, max: 4, message: '至多输入4个字符', trigger: 'change' },
          {
            pattern: /^([^\u4e00-\u9fa5])+$/,
            message: '禁止输入中文',
            trigger: 'change'
          },
          { required: true, message: '请填写代码编号', trigger: 'blur' }
        ],
        rvCmeaning: [
          { required: true, message: '请填写代码名称', trigger: 'blur' },
          { validator: RVNAME, trigger: 'change' }
          // {
          //   pattern: /^([0-9a-zA-Z\u4e00-\u9fa5])+$/,
          //   message: '只能输入中文字母数字',
          //   trigger: 'change'
          // }
        ],
        rvIsvalid: [{ required: true, message: '请选择有效标志', trigger: 'blur' }]
      }
    }
  },
  created() {
    this.resize = () => {
      this.typeHeight = this.$refs.topType.offsetHeight - 80
      // 70
      this.detlHeight = this.$refs.bottomCode.offsetHeight - 100
      // 130
    }
  },
  mounted() {
    let demandWrapper = document.querySelector('.demand .el-table__body-wrapper') // 新增滚动条监听事件
    scrollChange(demandWrapper)
  },
  beforeMount() {
    this.refreshList()
    checkSysfleetList({ fltAuditstatus: 'Y' }).then(res => {
      this.options = res.data
    })
  },
  computed: {
    grandson() {
      var dataList = []
      var number
      var arr = this.$route.path.split('/')
      number = arr.length - 1
      dataList = this.$store.state.user.permList
      for (var i = 0; i < dataList.length; i++) {
        for (var f = 0; f < dataList[i].Children.length; f++) {
          if (dataList[i].Children[f].MDL_CODE == arr[number]) {
            return dataList[i].Children[f].Grandson
          }
        }
      }
      return []
    },
    disableType() {
      return this.TypeDialogStatus === 'updateType'
    },
    addUp() {
      this.a = 0
      this.ruleForms.appointData.forEach(item => {
        //加法
        this.c = item.biddingQuota ? item.biddingQuota : 0
        var r1, r2, m
        try {
          r1 = this.c.toString().split('.')[1].length
        } catch (e) {
          r1 = 0
        }
        try {
          r2 = this.a.toString().split('.')[1].length
        } catch (e) {
          r2 = 0
        }
        m = Math.pow(10, Math.max(r1, r2))
        // eslint-disable-next-line vue/no-side-effects-in-computed-properties
        this.a = (this.c * m + this.a * m) / m
      })
      return Number(this.a)
    }
  },
  methods: {
    addSave() {
      updategys({ bidId: this.RefTypeData.bidId, bidAppointIds: this.addform.bidAppointIds }).then(res => {
        this.dialogFormVisible = false
        if (res.data == 1) {
          this.$message.success('保存成功')
          this.refreshList()
        }
      })
    },
    //添加供应商
    addgys() {
      let nowtime = new Date()
      let SignupEndtime = new Date(this.RefTypeData.bidSignupEnd)
      if (Object.keys(this.RefTypeData).length == 0) {
        this.$alert('请选择需要添加供应商的信息！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if (this.RefTypeData.bidBiddingstatus == 'N' || this.RefTypeData.bidInternalStatus == 'Y') {
        this.$alert('请选择已发布的信息', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if (nowtime >= SignupEndtime) {
        this.$alert('报名时间已经结束，无法添加', '提示', {
          confirmButtonText: '确定'
        })
        return
      }

      this.dialogFormVisible = true
      this.checked = false
      try {
        this.addform.bidAppointIds = this.RefTypeData.bidAppointIds.split(',')
      } catch (error) {
        console.log(error)
      }
    },
    selectAllgys() {
      this.addform.bidAppointIds = []
      if (this.checked) {
        this.options.map(item => {
          this.addform.bidAppointIds.push(item.uuid)
        })
      } else {
        this.addform.bidAppointIds = []
      }
    },
    selectAll() {
      this.value2 = []
      if (this.checked) {
        this.options.map(item => {
          this.value2.push(item.uuid)
        })
      } else {
        this.value2 = []
      }
    },
    addItem() {
      this.ruleForms.appointData.push({})
    },
    // 删除播放时间
    del(index) {
      this.ruleForms.appointData.splice(index, 1)
    },

    //调取父组件方法
    clickEventDom(item) {
      if (item.mdlCode === 'releaseBidding') {
        this.releaseBidding()
      } else if (item.mdlCode === 'delReleasee') {
        this.delReleasee()
      } else if (item.mdlCode === 'annouce') {
        this.annouce()
      } else if (item.mdlCode === 'internalSpecify') {
        this.internalSpecify()
      } else if (item.mdlCode === 'updateids') {
        this.addgys()
      }
    },
    typeIndex(index) {
      return (this.Pagination.currentPage - 1) * this.Pagination.pageSize + index + 1
    },
    /*对焦到下一个input框去*/
    nextFocus() {
      if (this.inputData.length == 2) {
        this.$refs.obj.focus()
      }
    },
    nextFocusA() {
      if (this.inputDataC.length == 2) {
        this.$refs.objA.focus()
      }
    },
    nextFocusB() {
      if (this.inputDataE.length == 2) {
        this.$refs.objB.focus()
      }
    },
    nextFocusC() {
      if (this.inputDataG.length == 2) {
        this.$refs.objC.focus()
      }
    },
    //竞价报名开始时间
    inputvalue(v) {
      let reg = /[^\d\.]/g
      let regExp = new RegExp(reg)
      if (v > 23) {
        this.$message.error({
          showClose: true,
          message: '小时不能大于23',
          type: 'warning'
        })
        this.inputData = ''
        return
      }
      if (regExp.test(v)) {
        this.$message.error({
          showClose: true,
          message: '只能输入数字',
          type: 'warning'
        })
      }
      if (v.length == 1) {
        this.inputData = '0' + this.inputData
      }
      this.ces()
    },
    inputvalueB(v) {
      let reg = /[^\d\.]/g
      let regExp = new RegExp(reg)
      if (v > 59) {
        this.$message.error({
          showClose: true,
          message: '分钟不能大于59',
          type: 'warning'
        })
        this.inputDataB = ''
        return
      }
      if (regExp.test(v)) {
        this.$message.error({
          showClose: true,
          message: '只能输入数字',
          type: 'warning'
        })
      }
      if (v.length == 1) {
        this.inputDataB = '0' + this.inputDataB
      }
      this.ces()
    },
    //竞价报名结束时间
    inputvalueC(v) {
      let reg = /[^\d\.]/g
      let regExp = new RegExp(reg)
      if (v > 23) {
        this.$message.error({
          showClose: true,
          message: '小时不能大于23',
          type: 'warning'
        })
        this.inputDataC = ''
        return
      }
      if (regExp.test(v)) {
        this.$message.error({
          showClose: true,
          message: '只能输入数字',
          type: 'warning'
        })
      }
      if (v.length == 1) {
        this.inputDataC = '0' + this.inputDataC
      }
      this.ces2()
    },
    inputvalueD(v) {
      let reg = /[^\d\.]/g
      let regExp = new RegExp(reg)
      if (v > 59) {
        this.$message.error({
          showClose: true,
          message: '分钟不能大于59',
          type: 'warning'
        })
        this.inputDataD = ''
        return
      }
      if (regExp.test(v)) {
        this.$message.error({
          showClose: true,
          message: '只能输入数字',
          type: 'warning'
        })
      }
      if (v.length == 1) {
        this.inputDataD = '0' + this.inputDataD
      }
      this.ces2()
    },
    //竞价开始时间
    inputvalueE(v) {
      let reg = /[^\d\.]/g
      let regExp = new RegExp(reg)
      if (v > 23) {
        this.$message.error({
          showClose: true,
          message: '小时不能大于23',
          type: 'warning'
        })
        this.inputDataE = ''
        return
      }
      if (regExp.test(v)) {
        this.$message.error({
          showClose: true,
          message: '只能输入数字',
          type: 'warning'
        })
      }
      if (v.length == 1) {
        this.inputDataE = '0' + this.inputDataE
      }
      this.ces3()
    },
    inputvalueF(v) {
      let reg = /[^\d\.]/g
      let regExp = new RegExp(reg)
      if (v > 59) {
        this.$message.error({
          showClose: true,
          message: '分钟不能大于59',
          type: 'warning'
        })
        this.inputDataF = ''
        return
      }
      if (regExp.test(v)) {
        this.$message.error({
          showClose: true,
          message: '只能输入数字',
          type: 'warning'
        })
      }
      if (v.length == 1) {
        this.inputDataF = '0' + this.inputDataF
      }
      this.ces3()
    },
    //竞价结束时间
    inputvalueG(v) {
      let reg = /[^\d\.]/g
      let regExp = new RegExp(reg)
      if (v > 23) {
        this.$message.error({
          showClose: true,
          message: '小时不能大于23',
          type: 'warning'
        })
        this.inputDataG = ''
        return
      }
      if (regExp.test(v)) {
        this.$message.error({
          showClose: true,
          message: '只能输入数字',
          type: 'warning'
        })
      }
      if (v.length == 1) {
        this.inputDataG = '0' + this.inputDataG
      }
      this.ces4()
    },
    inputvalueH(v) {
      let reg = /[^\d\.]/g
      let regExp = new RegExp(reg)
      if (v > 59) {
        this.$message.error({
          showClose: true,
          message: '分钟不能大于59',
          type: 'warning'
        })
        this.inputDataH = ''
        return
      }
      if (regExp.test(v)) {
        this.$message.error({
          showClose: true,
          message: '只能输入数字',
          type: 'warning'
        })
      }
      if (v.length == 1) {
        this.inputDataH = '0' + this.inputDataH
      }
      this.ces4()
    },

    dialogBeforeClose(done) {
      this.$confirm('确认关闭?')
        .then(() => {
          done()
        })
        .catch(() => {})
    },
    ces() {
      let vbsStartime
      let vbsEndtime
      vbsStartime = new Date(Date.parse(this.RefTypeData.bidSignupStart + ' ' + this.inputData + ':' + this.inputDataB))
      vbsEndtime = new Date(Date.parse(this.RefTypeData.bidSignupEnd + ' ' + this.inputDataC + ':' + this.inputDataD))
      let startime = new Date(Date.parse(this.RefTypeData.bidBiddingStart + ' ' + this.inputDataE + ':' + this.inputDataF))
      var d = new Date()
      if (vbsStartime.getTime() == d.getTime() - 86400000 || vbsStartime.getTime() < d.getTime()) {
        if (this.inputData && this.inputData < d.getHours()) {
          this.inputData = ''
          this.$message.error({
            showClose: true,
            message: '不能填写过去的时间！',
            type: 'warning',
            duration: 8000
          })
        }
        if (this.inputData && this.inputData == d.getHours() && this.inputDataB && this.inputDataB < d.getMinutes()) {
          this.inputDataB = ''
          this.$message.error({
            showClose: true,
            message: '不能填写过去的时间！',
            type: 'warning',
            duration: 8000
          })
        }
      }
      if (this.RefTypeData.bidSignupEnd != '' && this.inputDataC != '' && this.inputDataD != '') {
        if (vbsStartime >= vbsEndtime) {
          this.RefTypeData.bidSignupStart = ''
          this.inputData = ''
          this.inputDataB = ''
          this.$message.error({
            showClose: true,
            message: '竞价报名开始时间不能大于等于竞价报名结束时间！',
            type: 'warning',
            duration: 8000
          })
        }
      }
      if (this.RefTypeData.bidBiddingStart != '' && this.inputDataE != '' && this.inputDataF != '') {
        if (vbsStartime > startime) {
          this.RefTypeData.bidSignupStart = ''
          this.inputData = ''
          this.inputDataB = ''
          this.$message.error({
            showClose: true,
            message: '竞价报名开始时间不能大于竞价开始时间！',
            type: 'warning',
            duration: 8000
          })
        }
      }
    },
    ces2() {
      let vbsStartime
      let vbsEndtime
      vbsStartime = new Date(Date.parse(this.RefTypeData.bidSignupStart + ' ' + this.inputData + ':' + this.inputDataB))
      vbsEndtime = new Date(Date.parse(this.RefTypeData.bidSignupEnd + ' ' + this.inputDataC + ':' + this.inputDataD))
      let endtime = new Date(Date.parse(this.RefTypeData.bidBiddingStart + ' ' + this.inputDataE + ':' + this.inputDataF))
      var d = new Date()
      if (vbsEndtime.getTime() == d.getTime() - 86400000 || vbsEndtime.getTime() < d.getTime()) {
        if (this.inputDataC && this.inputDataC < d.getHours()) {
          this.inputDataC = ''
          this.$message.error({
            showClose: true,
            message: '不能填写过去的时间！',
            type: 'warning',
            duration: 8000
          })
        }
        if (this.inputDataC && this.inputDataC == d.getHours() && this.inputDataD && this.inputDataD < d.getMinutes()) {
          this.inputDataD = ''
          this.$message.error({
            showClose: true,
            message: '不能填写过去的时间！',
            type: 'warning',
            duration: 8000
          })
        }
      }
      if (this.RefTypeData.bidBiddingStart != '' && this.inputDataE != '' && this.inputDataF != '') {
        if (vbsEndtime >= endtime) {
          this.RefTypeData.bidSignupEnd = ''
          this.inputDataC = ''
          this.inputDataD = ''
          this.$message.error({
            showClose: true,
            message: '竞价报名结束始时间不能大于竞价开始时间！',
            type: 'warning',
            duration: 8000
          })
        }
      }

      if (this.RefTypeData.bidSignupEnd != '' && this.inputDataC != '' && this.inputDataD != '') {
        if (vbsStartime >= vbsEndtime) {
          this.RefTypeData.bidSignupEnd = ''
          this.inputDataC = ''
          this.inputDataD = ''
          this.$message.error({
            showClose: true,
            message: '竞价报名结束时间不能小于等于竞价报名开始时间！',
            type: 'warning',
            duration: 8000
          })
        }
      }
    },
    ces3() {
      let vbsStartime
      let vbsEndtime
      vbsStartime = new Date(Date.parse(this.RefTypeData.bidBiddingStart + ' ' + this.inputDataE + ':' + this.inputDataF))
      let startime = new Date(Date.parse(this.RefTypeData.bidSignupEnd + ' ' + this.inputDataC + ':' + this.inputDataD))
      vbsEndtime = new Date(Date.parse(this.RefTypeData.bidBiddingEnd + ' ' + this.inputDataG + ':' + this.inputDataH))
      var d = new Date()
      if (vbsStartime.getTime() == d.getTime() - 86400000 || vbsStartime.getTime() < d.getTime()) {
        if (this.inputDataE && this.inputDataE < d.getHours()) {
          this.inputDataE = ''
          this.$message.error({
            showClose: true,
            message: '不能填写过去的时间！',
            type: 'warning',
            duration: 8000
          })
        }
        if (this.inputDataE && this.inputDataE == d.getHours() && this.inputDataF && this.inputDataF < d.getMinutes()) {
          this.inputDataF = ''
          this.$message.error({
            showClose: true,
            message: '不能填写过去的时间！',
            type: 'warning',
            duration: 8000
          })
        }
      }
      if (this.RefTypeData.bidBiddingStart != '' && this.inputDataE != '' && this.inputDataF != '') {
        if (startime >= vbsStartime) {
          this.RefTypeData.bidBiddingStart = ''
          this.inputDataE = ''
          this.inputDataF = ''
          this.$message.error({
            showClose: true,
            message: '竞价开始时间不能小于等于竞价报名结束时间！',
            type: 'warning',
            duration: 8000
          })
        }
      }

      if (this.RefTypeData.bidBiddingEnd != '' && this.inputDataG != '' && this.inputDataH != '') {
        if (vbsStartime >= vbsEndtime) {
          this.RefTypeData.bidBiddingStart = ''
          this.inputDataE = ''
          this.inputDataF = ''
          this.$message.error({
            showClose: true,
            message: '竞价开始时间不能大于等于竞价结束时间！',
            type: 'warning',
            duration: 8000
          })
        }
      }
    },
    ces4() {
      let vbsStartime
      let vbsEndtime
      vbsStartime = new Date(Date.parse(this.RefTypeData.bidBiddingStart + ' ' + this.inputDataE + ':' + this.inputDataF))
      vbsEndtime = new Date(Date.parse(this.RefTypeData.bidBiddingEnd + ' ' + this.inputDataG + ':' + this.inputDataH))
      let endtime = new Date(Date.parse(this.RefTypeData.bidSignupEnd + ' ' + this.inputDataC + ':' + this.inputDataD))
      var d = new Date()
      if (vbsEndtime.getTime() == d.getTime() - 86400000 || vbsEndtime.getTime() < d.getTime()) {
        if (this.inputDataG && this.inputDataG < d.getHours()) {
          this.inputDataG = ''
          this.$message.error({
            showClose: true,
            message: '不能填写过去的时间！',
            type: 'warning',
            duration: 8000
          })
        }
        if (this.inputDataG && this.inputDataG == d.getHours() && this.inputDataH && this.inputDataH < d.getMinutes()) {
          this.inputDataH = ''
          this.$message.error({
            showClose: true,
            message: '不能填写过去的时间！',
            type: 'warning',
            duration: 8000
          })
        }
      }
      if (this.RefTypeData.bidBiddingEnd != '' && this.inputDataG != '' && this.inputDataH != '') {
        if (endtime > vbsEndtime) {
          this.RefTypeData.bidBiddingEnd = ''
          this.inputDataG = ''
          this.inputDataH = ''
          this.$message.error({
            showClose: true,
            message: '竞价结束始时间不能小于竞价报名结束时间！',
            type: 'warning',
            duration: 8000
          })
        }
      }
      if (this.RefTypeData.bidBiddingEnd != '' && this.inputDataG != '' && this.inputDataH != '') {
        if (vbsStartime >= vbsEndtime) {
          this.RefTypeData.bidBiddingEnd = ''
          this.inputDataG = ''
          this.inputDataH = ''
          this.$message.error({
            showClose: true,
            message: '竞价结束时间不能小于等于竞价开始时间！',
            type: 'warning',
            duration: 8000
          })
        }
      }
    },
    startTimeChange() {
      this.ces()
    },
    endTimeChange() {
      this.ces2()
    },
    startTimeBidding() {
      this.ces3()
    },
    endTimeBidding() {
      this.ces4()
    },

    //判断报价是否在报价范围内
    inOfeer(index) {
      console.log('1111--' + index)
      var regStrs = [
        ['[^\\d\\.]+$', ''], //禁止录入任何非数字和点
        ['\\.(\\d?)\\.+', '.$1'], //禁止录入两个以上的点
        ['^(\\d+\\.\\d{2}).+', '$1'] //禁止录入小数点后两位以上
      ]
      for (var i = 0; i < regStrs.length; i++) {
        var reg = new RegExp(regStrs[i][0])
        this.ruleForms.appointData[index].biddingPrice = this.ruleForms.appointData[index].biddingPrice.replace(reg, regStrs[i][1])
      }

      if (
        this.ruleForms.appointData[index].biddingPrice < this.RefTypeData.bidOfferStart ||
        this.ruleForms.appointData[index].biddingPrice > this.RefTypeData.bidOfferEnd
      ) {
        this.$alert('单价要在规定的报价范围内！', '提示', {
          confirmButtonText: '确定'
        })
        this.ruleForms.appointData[index].biddingPrice = ''
        return
      }
    },

    inQuotaOfeer(index) {
      if (this.addUp > this.currentCode.transportQuantity) {
        this.$message.error('配额吨数不能超过运输总吨数')
        this.ruleForms.appointData[index].biddingQuota = ''
      }
      //减法
      var arg1 = this.currentCode.transportQuantity
      var arg2 = this.addUp
      var r1, r2, m, n
      try {
        r1 = arg1.toString().split('.')[1].length
      } catch (e) {
        r1 = 0
      }
      try {
        r2 = arg2.toString().split('.')[1].length
      } catch (e) {
        r2 = 0
      }
      m = Math.pow(10, Math.max(r1, r2))
      n = r1 >= r2 ? r1 : r2
      this.b = ((arg1 * m - arg2 * m) / m).toFixed(n)
    },

    vaidateCycle() {
      if (this.RefTypeData.bidOfferStart > this.RefTypeData.bidOfferEnd) {
        this.$message.error('报价范围初始值不能大于最终值！')
        this.RefTypeData.bidOfferStart = ''
      }
    },
    vaidateEnd() {
      if (this.RefTypeData.bidOfferStart > this.RefTypeData.bidOfferEnd) {
        this.$message.error('报价范围最终值不能小于初始值！')
        this.RefTypeData.bidOfferStart = ''
      }
    },
    checkCode() {
      this.flt.RV_DOMAIN = this.flt.RV_DOMAIN.replace(/[^a-zA-Z]/g, '')
    },
    typecheck() {
      this.RefTypeData.RV_DOMAIN = this.RefTypeData.RV_DOMAIN.replace(/[^a-zA-Z]/g, '')
    },
    codecheck() {
      this.RefCodeData.RV_DOMAIN = this.RefCodeData.RV_DOMAIN.replace(/[^a-zA-Z]/g, '')
    },
    uppercase(key) {
      this.$refs.typePagination.lastEmittedPage = 1
      this.$refs.codePagination.lastEmittedPage = 1
      this.flt[key] = this.flt[key].toUpperCase()
    },
    // typeuppercase(key) {
    //   this.RefTypeData[key] = this.RefTypeData[key].toUpperCase()
    // },
    codeuppercase(key) {
      this.RefCodeData[key] = this.RefCodeData[key].toUpperCase()
    },
    getFltType() {
      addCodeTableXL({}).then(res => {
        if (res.success === '1') {
          this.rleTypes = res.data
        }
      })
    },
    searchType() {
      this.$refs.queryParam.validate(valid => {
        if (valid) {
          this.Pagination.currentPage = 1
          this.getList(this.Pagination.currentPage, this.Pagination.pageSize, this.updatePaginationTotal)
        }
      })
    },
    //获取列表
    getList(currentPage, pageSize, updateTotal) {
      this.currentCodeList = []
      this.RefTypeData = {}
      this.selNoApproveArray = []
      this.selApproveArray = []
      this.rowIdArray = []
      var internalStatus
      var biddingstatus
      if (this.queryParam.bidBiddingstatus == 'Y') {
        internalStatus = 'N'
        biddingstatus = 'Y'
      } else if (this.queryParam.bidBiddingstatus == 'I') {
        internalStatus = 'Y'
        biddingstatus = 'Y'
      } else if (this.queryParam.bidBiddingstatus == 'B') {
        internalStatus = 'Y'
        biddingstatus = 'N'
      } else if (this.queryParam.bidBiddingstatus == 'N') {
        internalStatus = 'N'
        biddingstatus = 'N'
      }
      queryBiddingList({
        bidCode: this.queryParam.bidCode,
        bidBiddingstatus: biddingstatus, //已发布竞价
        bidAuditstatus: 'Y', //已审核
        bidInternalStatus: internalStatus, //显示内部指定
        PageIndexs: this.Pagination.currentPage.toString(),
        PageSizes: this.Pagination.pageSize.toString()
      }).then(response => {
        this.TypeList = response.data
        updateTotal(Number(response.total))
      })
    },

    // 发布竞价信息
    releaseBidding() {
      if (this.selNoApproveArray.length < 1) {
        if (this.currentCodeList.length == 0) {
          this.$alert('选择的信息无需求信息，不可发布！', '提示', {
            confirmButtonText: '确定'
          })
          return
        }
        if (Object.keys(this.RefTypeData).length == 0) {
          this.$alert('请选择需要发布的信息！', '提示', {
            confirmButtonText: '确定'
          })
          return
        }
        if (this.RefTypeData.bidBiddingstatus == 'Y') {
          this.$alert('请选择未发布的信息', '提示', {
            confirmButtonText: '确定'
          })
          return
        }

        this.RefTypeData.bidIds = []
        this.checked = false
        this.RefTypeData.bidIds.push(this.RefTypeData.bidId)
        this.value2 = []
        if (this.RefTypeData.bidAppointIds) {
          this.value2 = this.RefTypeData.bidAppointIds.split(',')
        }
        this.RefTypeDialogVisible = true
        this.inputData = ''
        this.inputDataB = ''
        this.inputDataC = ''
        this.inputDataD = ''
        this.inputDataE = ''
        this.inputDataF = ''
        this.inputDataG = ''
        this.inputDataH = ''
      } else {
        if (this.selNoApproveArray.length == 0) {
          this.$alert('请选择未发布的信息', '提示', {
            confirmButtonText: '确定'
          })
          return
        }
        this.RefTypeData.bidIds = []
        this.selNoApproveArray.forEach(element => {
          this.RefTypeData.bidIds.push(element.bidId)
        })
        this.RefTypeDialogVisible = true
        this.inputData = ''
        this.inputDataB = ''
        this.inputDataC = ''
        this.inputDataD = ''
        this.inputDataE = ''
        this.inputDataF = ''
        this.inputDataG = ''
        this.inputDataH = ''
      }
    },
    // 取消发布
    delReleasee() {
      if (this.selApproveArray.length < 1) {
        if (Object.keys(this.RefTypeData).length == 0) {
          this.$alert('请选择需要取消发布的信息！', '提示', {
            confirmButtonText: '确定'
          })
          return
        }
        if (this.RefTypeData.bidBiddingstatus == 'N' || this.RefTypeData.bidInternalStatus == 'Y') {
          this.$alert('请选择已发布的信息', '提示', {
            confirmButtonText: '确定'
          })
          return
        }
        this.RefTypeData.bidIds = []
        this.RefTypeData.bidIds.push(this.RefTypeData.bidId)
      } else {
        if (this.selApproveArray.length == 0) {
          this.$alert('请选择已发布的信息', '提示', {
            confirmButtonText: '确定'
          })
          return
        }
        this.RefTypeData.bidIds = []
        this.selApproveArray.forEach(element => {
          this.RefTypeData.bidIds.push(element.bidId)
        })
      }
      this.releaseDel()
    },

    // 确认发布
    releaseTrue() {
      this.$refs['RefTypeData'].validate(valid => {
        if (!valid) {
          // this.$message.error('必输项不能为空！')
          return false
        }
        if (
          this.inputData == '' ||
          this.inputDataB == '' ||
          this.inputDataC == '' ||
          this.inputDataD == '' ||
          this.inputDataE == '' ||
          this.inputDataF == '' ||
          this.inputDataG == '' ||
          this.inputDataH == ''
        ) {
          this.$message.error({
            showClose: true,
            message: '小时分钟不能为空',
            type: 'warning'
          })
          return
        }
        let str = this.value2.join(',')
        if (this.RefTypeData.bidPlatformTogether == 'Y' && !str) {
          this.$alert('该信息与平台合作需指定供应商！请先指定', '提示', {
            confirmButtonText: '确定'
          })
          return
        }

        releaseBiddingMethod({
          bidIds: this.RefTypeData.bidIds,
          bidBiddingstatus: 'Y',
          bidSignupStart: this.RefTypeData.bidSignupStart + '' + this.inputData + ':' + this.inputDataB,
          bidSignupEnd: this.RefTypeData.bidSignupEnd + ' ' + this.inputDataC + ':' + this.inputDataD,
          bidBiddingStart: this.RefTypeData.bidBiddingStart + ' ' + this.inputDataE + ':' + this.inputDataF,
          bidBiddingEnd: this.RefTypeData.bidBiddingEnd + ' ' + this.inputDataG + ':' + this.inputDataH,
          // bidServiceCharge:this.RefTypeData.bidServiceCharge,
          bidOfferStart: this.RefTypeData.bidOfferStart,
          bidOfferEnd: this.RefTypeData.bidOfferEnd,
          bidAppointIds: str
        }).then(res => {
          if (res.success === '1') {
            this.$message({
              type: 'success',
              message: '发布成功'
            })
            this.inputData = ''
            this.inputDataB = ''
            this.inputDataC = ''
            this.inputDataD = ''
            this.inputDataE = ''
            this.inputDataF = ''
            this.inputDataG = ''
            this.inputDataH = ''
            this.RefTypeDialogVisible = false
            this.RefTypeData = {}
            this.selNoApproveArray = []
            this.selApproveArray = []
            this.refreshList()
          }
        })
      })
    },

    releaseDel() {
      this.$confirm('您确定要取消发布该竞价信息吗？', '提示', {
        confirmButtonText: '确定'
      }).then(() => {
        releaseBiddingMethod({
          bidId: this.RefTypeData.bidId,
          bidIds: this.RefTypeData.bidIds,
          bidBiddingstatus: 'N',
          bidInternalStatus: this.RefTypeData.bidInternalStatus
        }).then(res => {
          if (res.success === '1') {
            this.$message({
              type: 'success',
              message: '取消发布成功'
            })
            this.RefTypeData = {}
            this.selNoApproveArray = []
            this.selApproveArray = []
            this.refreshList()
          }
        })
      })
    },

    //公告发布
    annouce() {
      if (Object.keys(this.RefTypeData).length == 0) {
        this.$alert('请选择需要发布公告的信息！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if (this.RefTypeData.bidBiddingstatus == 'N') {
        this.$alert('请选择已发布的信息', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      // queryAnnouncement({bidId:this.RefTypeData.bidId,
      // bidType:'F'
      // }).then(res=>{
      //   if(res.success==='1'){
      //     if(res.data.length > 0){
      //       this.annouceData = res.data[0]
      //     }else{
      //       this.annouceData = {}
      //     }
      //     this.annoucetDialog = true
      //   }
      // })
      this.annoucetDialog = true
    },

    //确认发布公告
    annouceTrue() {
      this.$refs['annouceData'].validate(valid => {
        if (!valid) {
          // this.$message.error('必输项不能为空！')
          return false
        }
        addAnnouncement({
          baId: this.annouceData.baId,
          bidId: this.RefTypeData.bidId,
          bidTitle: this.annouceData.bidTitle,
          bidContent: this.annouceData.bidContent,
          bidType: 'F'
        }).then(res => {
          if (res.success === '1') {
            // 附件上传
            this.annexDialog.data.id = res.data
            if (this.annexDialog.fileList.length) {
              this.$refs['annexUpload'].submit()
            }
            this.$message({
              type: 'success',
              message: '公告发布成功'
            })
            this.annoucetDialog = false
          }
        })
      })
    },

    //内部指定按钮
    internalSpecify() {
      if (this.RefTypeData.bidBiddingstatus == 'Y' && this.RefTypeData.bidInternalStatus != 'Y') {
        this.$alert('该信息已发布，不可内部指定！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if (this.selApproveArray.length != 0) {
        this.$alert('选中信息存在已指定信息，请只选择未指定的信息', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if (this.selNoApproveArray.length < 1) {
        this.RefCodeData = Object.assign({}, this.currentCode)
        if (Object.keys(this.RefCodeData).length == 0) {
          this.$alert('请选择需要内部指定的需求信息！', '提示', {
            confirmButtonText: '确定'
          })
          return
        }
        if (this.RefCodeData.terminationWeight) {
          this.a = 0
          this.b = 0
          this.currentCode.id = null
          this.currentCode.transportQuantity = this.RefCodeData.terminationWeight
          this.ruleForms.appointData[0].biddingQuota = this.RefCodeData.terminationWeight
        } else {
          if (this.RefCodeData.id) {
            this.$alert('请选择未指定的需求信息！', '提示', {
              confirmButtonText: '确定'
            })
            return
          }
          this.a = 0
          this.b = 0
          this.ruleForms.appointData[0].biddingQuota = this.currentCode.transportQuantity
        }
      } else {
        if (this.selNoApproveArray.length == 0) {
          this.$alert('请选择需要内部指定的需求信息！', '提示', {
            confirmButtonText: '确定'
          })
          return
        }
      }
      this.appointDialogVisible = true
    },

    //取消内部指定按钮
    delInternalSpecify() {
      let ids = []
      if (this.selNoApproveArray.length != 0) {
        this.$alert('选中信息存在未指定信息，请只选择已指定的信息', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if (this.selApproveArray.length < 1) {
        this.RefCodeData = Object.assign({}, this.currentCode)
        if (Object.keys(this.RefCodeData).length == 0) {
          this.$alert('请选择需要取消内部指定的需求信息！', '提示', {
            confirmButtonText: '确定'
          })
          return
        }
        if (!this.RefCodeData.id) {
          this.$alert('请选择已内部指定的需求信息！', '提示', {
            confirmButtonText: '确定'
          })
          return
        }
      } else {
        if (this.selApproveArray.length == 0) {
          this.$alert('请选择需要取消内部指定的需求信息！', '提示', {
            confirmButtonText: '确定'
          })
          return
        }
        this.selApproveArray.forEach(element => {
          ids.push(element.id)
        })
      }
      this.$confirm('您确定要取消内部指定吗？', '提示', {
        confirmButtonText: '确定'
      }).then(() => {
        //按需取消内部指定
        delInternalDesignation({
          sugarId: this.RefCodeData.sugarId,
          bidId: this.RefTypeData.bidId
        }).then(res => {
          if (res.success === '1') {
            this.$message({
              type: 'success',
              message: '取消内部指定成功'
            })
            this.appointData = {}
            this.selNoApproveArray = []
            this.selApproveArray = []
            this.newDelRefresh()
          }
        })
      })
    },

    //确定内部指定
    appointTrue() {
      if (this.a != this.currentCode.transportQuantity) {
        this.$message.error('当前运输总数量还有剩余,需全部配额')
        return
      }
      this.$refs['ruleForms'].validate(valid => {
        if (!valid) {
          // this.$message.error('必输项不能为空！')
          return false
        }
        this.RefCodeData = Object.assign({}, this.currentCode)
        if (this.selNoApproveArray.length < 1) {
          var i = 1
          //按需内部指定
          this.ruleForms.appointData.forEach(element => {
            internalDesignationBidding({
              id: this.RefCodeData.id,
              bidId: this.RefTypeData.bidId,
              sugarId: this.RefCodeData.sugarId,
              bidInternalId: element.bidInternalSpecify,
              biddingQuota: element.biddingQuota,
              biddingPrice: element.biddingPrice
            }).then(res => {
              if (res.success === '1' && i === this.ruleForms.appointData.length) {
                this.$message({
                  type: 'success',
                  message: '内部指定成功'
                })
                this.appointDialogVisible = false
                ;(this.ruleForms.appointData = [
                  {
                    bidInternalSpecify: '',
                    biddingPrice: '',
                    biddingQuota: ''
                  }
                ]),
                (this.selNoApproveArray = [])
                this.selApproveArray = []
                this.newRefresh()
              }
              i++
            })
          })
        } else {
          var i = 1
          this.selNoApproveArray.forEach(element => {
            //按需内部指定
            internalDesignationBidding({
              id: element.id,
              bidId: this.RefTypeData.bidId,
              sugarId: element.sugarId,
              bidInternalId: this.appointData.bidInternalSpecify,
              biddingPrice: this.appointData.biddingPrice
            }).then(res => {
              if (res.success === '1' && i === this.selNoApproveArray.length) {
                this.$message({
                  type: 'success',
                  message: '内部指定成功'
                })
                this.appointDialogVisible = false
                this.appointData = {}
                this.selNoApproveArray = []
                this.selApproveArray = []
                this.newRefresh()
              }
              i++
            })
          })
        }

        //按标内部指定（弃用）
        // internalSpecifyBidding({
        //   bidId:this.RefTypeData.bidId,
        //   bidBiddingstatus:'Y',//发布状态
        //   bidInternalStatus:'Y',//内部指定状态
        //   sugarIds:this.RefTypeData.sugarIds,
        //   bidInternalSpecify:this.appointData.bidInternalSpecify,
        //   biddingPrice:this.appointData.biddingPrice}).then(res=>{
        //   if(res.success==='1'){
        //     this.$message({
        //       type:'success',
        //       message:'内部指定成功',
        //     })
        //     this.appointDialogVisible = false
        //     this.RefTypeData = {}
        //     this.selNoApproveArray=[]
        //     this.selApproveArray=[]
        //     this.refreshList()
        //   }
        // })
      })
    },

    //刷新下半部数据，当全部指定时，刷新页面
    newRefresh() {
      this.currentCode = {}
      this.RefCodeData = {}
      this.currentPage = 1
      this.pageSize = 30
      this.pageTotal = 0
      this.currentType = this.RefTypeData
      if (!this.RefTypeData.bidOfferStart) {
        this.RefTypeData.bidOfferStart = 0
      }
      if (!this.RefTypeData.bidOfferEnd) {
        this.RefTypeData.bidOfferEnd = 600
      }
      querySugarListDetail({
        bidId: this.RefTypeData.bidId
      }).then(res => {
        if (res.success == 1) {
          this.currentCodeList = res.data
          var i = 0
          this.currentCodeList.forEach(element => {
            if (element.id) {
              i++
            }
            if (i === this.currentCodeList.length || i == 1) {
              this.RefTypeData = {}
              this.refreshList()
            }
          })
        }
      })
    },

    //刷新下半部数据，当全部取消指定时，刷新页面
    newDelRefresh() {
      this.currentCode = {}
      this.RefCodeData = {}
      this.currentPage = 1
      this.pageSize = 30
      this.pageTotal = 0
      this.currentType = this.RefTypeData
      if (!this.RefTypeData.bidOfferStart) {
        this.RefTypeData.bidOfferStart = 0
      }
      if (!this.RefTypeData.bidOfferEnd) {
        this.RefTypeData.bidOfferEnd = 600
      }
      querySugarListDetail({
        bidId: this.RefTypeData.bidId
      }).then(res => {
        if (res.success == 1) {
          this.currentCodeList = res.data
          var i = 0
          this.currentCodeList.forEach(element => {
            if (!element.id) {
              i++
            }
            if (i === this.currentCodeList.length || i == 1) {
              this.RefTypeData = {}
              this.refreshList()
            }
          })
        }
      })
    },

    //指定供应商
    appointGys() {
      if (Object.keys(this.RefTypeData).length == 0) {
        this.$alert('请选择需要指定供应商的信息！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if (this.RefTypeData.bidBiddingstatus == 'Y') {
        this.$alert('请选择未发布的信息', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if (this.RefTypeData.bidPlatformTogether == 'N') {
        this.$alert('请选择与平台合作的的信息', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      this.RefTypeData.bidIds = []
      this.RefTypeData.bidIds.push(this.RefTypeData.bidId)
      this.value2 = []
      if (this.RefTypeData.bidAppointIds) {
        this.value2 = this.RefTypeData.bidAppointIds.split(',')
      }
      this.appointDialogVisible = true
    },

    // dialog 查看线路详细信息
    showTransportMethod(val) {
      queryDemandLine({
        sugarId: val.sugarId
      }).then(res => {
        if (res.success == 1) {
          this.tranDialogInfoList = res.data
        }
      })
      this.tranDialogInfoDialogVisible = true
    },

    internaDetail(val) {
      internalDesignationDetail({
        bidId: this.RefTypeData.bidId,
        sugarId: val.sugarId
      }).then(res => {
        if (res.success == 1) {
          this.internalList = res.data
        }
      })
      this.internalDialogVisible = true
    },

    // 获取当前选中行(一行)
    getCurrentTypeRow(row) {
      this.currentCode = {}
      this.RefCodeData = {}
      this.currentPage = 1
      this.pageSize = 30
      this.pageTotal = 0
      this.currentType = row
      this.RefTypeData = Object.assign({}, row)
      if (!row.bidOfferStart) {
        this.RefTypeData.bidOfferStart = 0
      }
      if (!row.bidOfferEnd) {
        this.RefTypeData.bidOfferEnd = 600
      }
      querySugarListDetail({
        bidId: row.bidId
      }).then(res => {
        if (res.success == 1) {
          this.currentCodeList = res.data
        }
      })
    },

    // 获取当前选中行(多行)
    rowSelectionChange(val) {
      this.selNoApproveArray = []
      this.selApproveArray = []
      if (val.length > 0) {
        for (var i = 0; i < val.length; i++) {
          if (val[i].id) {
            this.selApproveArray.push(val[i])
          }
          if (!val[i].id) {
            this.selNoApproveArray.push(val[i])
          }
        }
      }
    },

    // 点击基础代码表格的一行，获取到当前行的信息
    getCurrentCodeRow(row) {
      this.codeentRow = '1'
      this.currentCode = row
    },
    handleSizeChangeA(val) {
      this.pageSize = val
      this.getRefCode()
    },
    handleCurrentChangeA(val) {
      this.currentPage = val
      this.getRefCode()
    },

    handleTypeDialogClose() {
      this.RefTypeDialogVisible = false
      this.tranDialogInfoDialogVisible = false
      this.internalDialogVisible = false
    },
    handleCodeDialogClose() {
      (this.ruleForms.appointData = [
        {
          bidInternalSpecify: '',
          biddingPrice: '',
          biddingQuota: ''
        }
      ]),
      (this.appointDialogVisible = false)
    },
    // restet 基础代码
    resetRefCode() {
      return (this.RefCodeData = {
        // RCT_UUID: '',
        // RV_DOMAIN: '',
        // RV_CMEANING: '',
        // RV_NAME: '',
        // RV_ISVALID: 'Y',
        rvDomain: '',
        rvTerId: '-1',
        rvLowValue: '',
        rvCmeaning: '',
        rvIsvalid: 'Y'
        // rvInsertuser:'',
        // rvLstupduser:'',
      })
    },
    addAnnex() {
      this.annexDialog.title = '添加附件'
      this.annexDialog.show = true
    },
    // annexRemove(file, files) {
    //   for (let i in files) {
    //     if (files[i] === file) {
    //       files.splice(i, 1)
    //     }
    //   }
    // }
    fileUploadFileCallBack(err, file, fileList) {
      this.$message.error(`${file.name}上传失败`)
    },
    doUploadFile() {
      this.annexDialog.show = false
    },
    annexDialogClose() {
      this.$refs['annouceData'].resetFields()
      this.$refs['annexUpload'].clearFiles()
      this.getList(this.Pagination.currentPage, this.Pagination.pageSize, this.updatePaginationTotal)
    }
  }
}
</script>

<style lang="scss" scoped>
::v-deep .el-input__inner {
  height: 3rem;
}
//   ::v-deep .el-input--suffix{
//     line-height: 36px;
//   }
// ::v-deep .el-form-item{
//     width: 65%;
//     display: inline-block;
// }
::v-deep .splitter-pane-resizer.horizontal {
  margin-top: -10px;
}
.inline {
  display: inline-block;
}
.app-container {
  overflow: hidden;
  background-color: #fff;
  position: relative;
  height: 100%;
}
.tree {
  padding-right: 20px;
  font-size: 1.4rem;
}
.right-detail {
  height: 100%;
  .top-type {
    width: 100%;
    height: 100%;
    table {
      max-width: 100%;
      font-size: 1.4rem;
    }
  }
  .bottom-code {
    width: 100%;
    height: 100%;
  }
}
.codeNumberCode {
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 20px;
}
.basicInfoBox {
  border: 1px solid #cccccc;
  border-radius: 5px;
  padding-top: 25px;
  padding-bottom: 10px;
}
.heis {
  width: 100%;
  height: 65px;
  margin-top: -50px;
  margin-bottom: 10px;
  .biao {
    width: 250px;
    height: 60px;
    border: 2px solid #cccccc;
    line-height: 60px;
    font-size: 16px;
    border-radius: 8px;
    text-align: center;
    float: left;
    span {
      font-size: 18px;
      font-weight: bold;
      margin-top: 5px;
    }
  }
  .sysj {
    width: 180px;
    height: 60px;
    float: left;
    line-height: 60px;
    font-size: 16px;
    margin-left: 150px;
    position: relative;
  }
  .rigth {
    float: right;
    height: 60px;
    line-height: 60px;
    margin-right: 50px;
    font-size: 16px;
    color: #6d9eeb;
  }
  .left {
    float: left;
    height: 60px;
    line-height: 60px;
    margin-right: 50px;
    font-size: 16px;
    color: #6d9eeb;
  }
}
</style>
